const path = require('path')
const DonePlugin = require('./plugins/DonePlugins.js')
const AsyncPlugin = require('./plugins/AsyncPlugin.js')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FileListPlugin = require('./plugins/FileListPlugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const InlineSourcePlugin = require('./plugins/InlineSourcePlugin')
const UploadPlugin = require('./plugins/UploadPlugin')
module.exports = {
  mode: 'development',
  entry: './src/index.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist'),
    publicPath: 'http://qk172p3l9.hn-bkt.clouddn.com/'
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [MiniCssExtractPlugin.loader, 'css-loader']
      }
    ],
  },
  plugins: [
    new UploadPlugin({
      bucket: 'learn-mjx', // 上传资源
      domain: 'qk172p3l9.hn-bkt.clouddn.com', // 上传哪个域名
      accessKey: 'WmRzyPIuJ4xaLusZfP06R_aiSjzJCAafcir9-JON',
      secretKey: 'LL0qUZ61Kw3EU16MiaVIWW5-UHJKtY_RBAPZ1jsk'
    }),
    new MiniCssExtractPlugin({
      filename: 'main.css'
    }),
    new HtmlWebpackPlugin({
      template: './src/index.html'
    }),
    new FileListPlugin({
      filename: 'list.md'
    }),
    // new InlineSourcePlugin({
    //   match: /\.(js|css)$/
    // })
    // new DonePlugin(),
    // new AsyncPlugin(),
  ]

}